import 'dart:ui';

import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter/rendering.dart';

class ScreenAdapter extends StatefulWidget {
  const ScreenAdapter({Key? key}) : super(key: key);

  @override
  State<ScreenAdapter> createState() => _ListWheelViewPortDemoState();
}

class _ListWheelViewPortDemoState extends State<ScreenAdapter> {
  List<Color> data = [];

  @override
  void initState() {
    super.initState();
  }

  @override
  Widget build(BuildContext context) {
    final mediaQuery = MediaQuery.of(context);
    final sw = mediaQuery.size.width;
    final sh = mediaQuery.size.height;
    final pw = window.physicalSize.width;
    final ph = window.physicalSize.height;
    final dpr = window.devicePixelRatio;
    print('屏幕宽：$sw 屏幕高：$sh');
    print('分辨率：$pw - $ph');
    print('dpr:$dpr');
    return MaterialApp(
      title: "ScreenAdapter",
      home: Scaffold(
          appBar: AppBar(
            title: Text('屏幕适配'),
          ),
          body: Column(
            children: [],
          )),
    );
  }
}
